<!--
 * @Author: daidai
 * @Date: 2022-03-01 15:51:43
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-09-29 15:12:46
 * @FilePath: \web-pc\src\pages\big-screen\view\indexs\right-bottom.vue
-->
<template>
  <div class="right_bottom">
    <dv-capsule-chart :config="config" style="width:100%;height:260px"/>
  </div>
</template>

<script>
import {alarmRank} from "@/api";

export default {
  data() {
    return {
      gatewayno: "",
      config: {
        showValue: true,
        unit: "次",
        data: []
      }

    };
  },
  created() {
    this.getData();

  },
  computed: {},
  mounted() {
  },
  unmounted() {
    console.log("right-center unmount");
    this.clearData();
  },
  methods: {
    clearData() {
      if (this.timer) {
        clearInterval(this.timer);
        this.timer = null;
      }
    },
    //轮询
    switper() {
      if (this.timer) {
        return;
      }
      let looper = (a) => {
        this.getData();
      };
      // this.timer = setInterval(looper, 10000);
    },
    getData() {
      this.pageflag = true;
      // this.pageflag =false
      alarmRank().then(res => {

        if (!this.timer) {
        }
        this.config = {
          ...this.config,
          data: res.data
        };
        this.switper();
      });
    }
  }
};
</script>
<style scoped>
@import "@/assets/css/variable.scss";

.list_Wrap {
  height: 100%;
  overflow: hidden;

  ::v-deep(.kong) {
    width: auto;
  }
}

.sbtxSwiperclass {
  .img_wrap {
    overflow-x: auto;
  }
}

.right_bottom {
  box-sizing: border-box;
  padding: 0 16px;

  .searchform {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;

    .searchform_item {
      display: flex;
      justify-content: center;
      align-items: center;

      label {
        margin-right: 10px;
        color: rgba(255, 255, 255, 0.8);
      }

      button {
        margin-left: 30px;
      }
    }
  }

  .img_wrap {
    display: flex;
    padding: 0 0 20px;
    overflow-x: auto;
    flex-wrap: nowrap;

    li {
      width: 105px;
      height: 137px;
      border-radius: 6px;
      cursor: pointer;
      flex-shrink: 0;
      margin: 0 10px;
      position: relative;
      overflow: hidden;

      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }
  }

  .noData {
    width: 100%;
    line-height: 100px;
    text-align: center;
    color: rgb(129, 128, 128);
  }
}
</style>